<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //类的声明
        class A{
            a=100;
            fn(){
                console.log('fn fn fn')
            }
        }

        class B extends A{
            //实例对象上
            fn = function(){
                console.log(111);
            }
            constructor(){
                super();//在子类的构造方法中, 必须要调用 super 函数
                this.x = 100;
            }
            //原型对象上
            fn(){
                console.log(222);
            }
        }

        let b = new B();

        b.fn();// ????
      

        function A(a,b){
            this.a = a;
            this.b = b;
        }

        function B(a,b,c,d){
            A.call(a,b);//等效于 super(a,b) 
        }



    </script>
</body>
</html>